package wechat_service

import "go_api/models/ucenter"

type WeChat struct {
	UID 					int
	OpenId 					string
	WeappOpenId 			string
	Nickname				string
	Avatar					string
	School					string
}



func (w *WeChat) GetWeChat() (error, *ucenter.WeChat)  {
	return ucenter.GetWeChat(w.WeappOpenId)
}

func(w *WeChat) ExistByOpenIdWeChat() (error, *ucenter.WeChat) {
	return ucenter.ExistByOpenIdWeChat(w.WeappOpenId, w.UID)
}


func (w *WeChat) AddWeChat() error{
	return ucenter.AddWeChat(w.UID, w.WeappOpenId, w.Nickname, w.Avatar, w.School)
}


func(w *WeChat) UpdateWeChatDeleteAt() error {
	return ucenter.UpdateWeChatDeleteAt(w.WeappOpenId, w.UID)
}


func(w *WeChat) DeleteWeChat() error {
	return ucenter.DeleteWeChat(w.WeappOpenId, w.UID)
}
